package edu.hubu.talentmanagementsystem.model.ext;


import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import edu.hubu.talentmanagementsystem.model.Model;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 角色表
 * </p>
 *
 * @author moonlan
 * @since 2021-03-13
 */
@TableName("role")
public class Role extends Model<Role> implements Serializable {


    /**
     * 角色ID
     */
    @TableId(value = "role_id", type = IdType.AUTO)
    private Integer roleId;

    /**
     * 角色名称
     */
    @TableField("role_name")
    private String roleName;

    /**
     * 角色是否被启用
     */
    @TableField("role_is_enable")
    private Boolean roleIsEnable;

    @TableField(exist = false)
    private List<Permission> permissions;

    public List<Permission> getPermissions() {
        return permissions;
    }

    public Role setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
        return this;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public Role setRoleId(Integer roleId) {
        this.roleId = roleId;
        return this;
    }

    public String getRoleName() {
        return roleName;
    }

    public Role setRoleName(String roleName) {
        this.roleName = roleName;
        return this;
    }

    public Boolean getRoleIsEnable() {
        return roleIsEnable;
    }

    public Role setRoleIsEnable(Boolean roleIsEnable) {
        this.roleIsEnable = roleIsEnable;
        return this;
    }

    @Override
    public String toString() {
        return "Role{" +
                "roleId=" + roleId +
                ", roleName=" + roleName +
                ", roleIsEnable=" + roleIsEnable +
                "}";
    }
}
